package com.example.cia.mysql.dao;

import java.io.IOException;
import java.sql.SQLException;

public interface IUser {

	/*
	 * 用户登录注册等相关操作
	 */
	
	/**
	 * 用户注册
	 * @param id 用户identifier
	 * @param password 用户密码
	 * @param address 用户地址
	 * @return true if regist succeed,otherwise false
	 */
	public boolean regist(int id,String password,String address);
	
	/**
	 * 用户登录
	 * @param id 用户identifier
	 * @param password 用户密码
	 * @return true if login succeed,otherwise false
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public boolean login(int id,String password) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 获取用户地址
	 * @param id 用户identifier
	 * @return 用户注册时填写的地址
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public String getAddress(int id) throws ClassNotFoundException, SQLException, IOException;
}
